package com.bdqn.boot.interceptor;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.servlet.http.HttpServletRequest;

/**
 * @author Hasee
 * @version 1.0
 * @className GlobalExceptionHandle
 * @description TODD
 * @date 2025/2/25 14:55
 */
@Slf4j
@ControllerAdvice
public class GlobalExceptionHandle {
    @ExceptionHandler({ArithmeticException.class,NullPointerException.class})
    public String handleException(Exception e, HttpServletRequest request) {
        log.info("异常信息：{}", e);
        return "error";
    }
}
